package com.azdebugit.java8.suanfa.arraydeue;

import java.util.ArrayDeque;

/**
 * @Author: itdebug
 * @Email: itdebug.fp@cosmos.com
 * @version:: design_pattern_and_otherutils
 * @description:
 * @create: 2021/12/13 10:14.
 */
public class ArrayDequeTest {
    public static void main(String[] args) {
        System.out.println("--------------ArrayDeque--------------");
        ArrayDeque<String> ad=new ArrayDeque<String>();
        ad.push("1");
        ad.push("2");
        ad.push("3");
        ad.push("3");
        ad.push("3");
        ad.push("4");
        ad.push("5");
        ad.push("5");
        ad.push("5");
        ad.push("6");

        ad.stream().forEach(e->{
            System.out.println(e);
        });

        System.out.println("----------poll-----------");


        System.out.println(ad.poll());
        System.out.println(ad.poll());
        System.out.println(ad.poll());
        System.out.println(ad.poll());
        System.out.println(ad.poll());
        System.out.println(ad.poll());



        System.out.println("----------offer-----------");
        ArrayDeque<String> ads=new ArrayDeque<String>();
        ads.offer("1");
        ads.offer("2");
        ads.offer("3");
        ads.offer("4");
        ads.offer("5");
        ads.offer("6");


        ads.stream().forEach(e->{
            System.out.println(e);
        });
    }
}
